#{extends 'main.html' /}
<h2>My Account</h2><hr/>
<a href = "@{Users.editPage()}">Edit Profile </a>&nbsp;&nbsp;|&nbsp;&nbsp;<a href="javascript:showDialogHelper('Confirmation','Are you sure you want to be deleted from the system ?',true,'@{Users.systemDeletionRequest()}','prompt');">Deactivate Account</a>
<hr/>
<h3 style="font-weight:bold;color:#800080;">Personal Information:</h3><br/>
<table width="450">
    <tr>
        <td>
        	<label style="font-weight:bold">First Name:</label>
        </td>
        <td>
        	<label> ${firstName} </label>
        </td>
    </tr>
    <tr>
        <td>
        	<label style="font-weight:bold">Middle Name:</label>
        </td>
        <td>
        	<label> ${middleName} </label>
        </td>
    </tr>
    <tr>
        <td>
        	<label style="font-weight:bold">Last Name:</label>
        </td>
        <td>
        	<label> ${lastName} </label>
        </td>
    </tr>
    <tr>
        <td>
        	<label style="font-weight:bold">Username:</label>
        </td>
        <td>
        	<label> ${userName} </label>
        </td>
    </tr>
    <tr>
        <td>
        	<label style="font-weight:bold">Email:</label>
        </td>
        <td>
        	<label> ${email} </label>
        </td>
    </tr>
    <tr>
        <td>
        	<label style="font-weight:bold">Country:</label>
        </td>
        <td>
        	<label> ${country} </label>
        </td>
    </tr>
    <tr>
        <td>
        	<label style="font-weight:bold">City:</label>
        </td>
        <td>
        	<label> ${city} </label>
        </td>
    </tr>
    <tr>
        <td>
        	<label style="font-weight:bold">Address:</label>
        </td>
        <td>
        	<label> ${address} </label>
        </td>
    </tr>
    <tr>
        <td>
        	<label style="font-weight:bold">Phone:</label>
        </td>
        <td>
        	<label> ${phone} </label>
        </td>
    </tr>
</table>
<br><br>
<h3 style="font-weight:bold;color:#800080;">Account Settings:</h3><br/>
<label style="font-weight:bold">Instant Notifications:</label><br><br>

<input type="radio" name="notify" id="notify_true" value="1"  onClick="javascript:changeValue(1)"/> On
<br /><br />
<input type="radio" name="notify" id="notify_false" value="0" onClick="javascript:changeValue(0)" /> Off

<script type="text/javascript">	
	$(document).ready(function(){
		$('#view_profile').hide();
		var user = '${session.get("userId")}';
		$.post('@{Users.getNotifyStatus()}', {userId:user}, function( send ){
				if ( send == true){					
					$('input[name="notify"]')[0].checked = true;
				}
				else{
					$('input[name="notify"]')[1].checked = true;

				}
		});		
	});
	
	function changeValue( id ){
		var user = '${session.get("userId")}';
		var status = id;		
		$.post('@{Users.changeNotifyStatus()}', {userId:user, status:status}, function(){
				
	});
	}
</script>

	